package com.miyake.rest;

import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.simpleframework.xml.Element;
import org.simpleframework.xml.ElementList;
import org.simpleframework.xml.ElementMap;

public class ChartServiceProperty {
    @Element(required=false)
    private String title;
    @Element
    private int width;
    @Element
    private int height;

    @ElementMap(required=false)
    private Map<String, String> axes = new HashMap<String, String>();
    
    /**
     * @return the width
     */
    public int getWidth() {
        return width;
    }
    /**
     * @param width the width to set
     */
    public void setWidth(int width) {
        this.width = width;
    }
    /**
     * @return the height
     */
    public int getHeight() {
        return height;
    }
    /**
     * @param height the height to set
     */
    public void setHeight(int height) {
        this.height = height;
    }
    
    public static ChartServiceProperty fromXml(InputStream stream) {
        return XmlSerializer.deserialize(stream, ChartServiceProperty.class);
    }

    public static ChartServiceProperty fromXml(String xml) {
        return XmlSerializer.deserialize(xml, ChartServiceProperty.class);
    }
    
    public String toXML() {
        return XmlSerializer.serialize(this);
    }
    /**
     * @return the title
     */
    public String getTitle() {
        return title;
    }
    /**
     * @param title the title to set
     */
    public void setTitle(String title) {
        this.title = title;
    }
    /**
     * @return the axes
     */
    public Map<String, String> getAxes() {
        return axes;
    }
    /**
     * @param axes the axes to set
     */
    public void setAxes(Map<String, String> axes) {
        this.axes = axes;
    }

}
